using System;
using Orchard.Gallery.Interfaces;
using Orchard.Users.Events;

namespace Orchard.Gallery.Handlers {
    public class UserEventHandler : IUserEventHandler {
        private readonly IUserkeyService _userkeyService;

        public UserEventHandler(IUserkeyService userkeyService) {
            _userkeyService = userkeyService;
        }

        public void Creating(UserContext context) {
            //Not handled
        }

        public void Created(UserContext context) {
            _userkeyService.SaveKeyForUser(context.User.Id, Guid.NewGuid());
        }
    }
}